#ifndef _DRV_DBUFF_H_
#define _DRV_DBUFF_H_

#include <stdint.h>
#include <stdio.h>
#include "drv_fifo.h"
//双缓冲
typedef struct _DBUFF
{
    uint8_t which;
#if USE_MALLOC
    QUEUE *queA;
    QUEUE *queB;
#else
    QUEUE queA[1];
    QUEUE queB[1];
#endif

} DBUFF;


void dbuff_switch(DBUFF *dbuff);
void dbuff_init(DBUFF *dbuff, uint8_t *dpA, uint16_t lenA, uint8_t *dpB, uint16_t lenB);
void dbuff_push(DBUFF *dbuff, uint8_t *data, uint16_t size);
uint8_t *dbuff_get_data(DBUFF *dbuff);
uint8_t dbuff_get_size(DBUFF *dbuff);

#endif
